<?php
/*
 * Author : dimitris
 */
session_start();

require_once('../BL/BL.php');


UI_initErrors();
$username = $_GET['username'];
$activation_code = $_GET['code'];

$retval = BL_activateUser($username, $activation_code);

if($retval == BL_OK){

	$id = BL_getIdfromUsername($username);
     $_SESSION['uid'] = $id;
     $_SESSION['username'] = $username;
     UI_registerError('msg_success', "Activation successful!");
	//echo "Activation Successful! <br>";
	//sleep(3);
	header('location:index.php');
	
}
?>
